package com.zzl.springboot.entity;

import java.io.Serializable;
import java.util.Date;

public class User implements Serializable {
    private Integer id;

    private String username;

    private String password;

    private Integer roleId;

    private Date createTime;

    private String userImg;

    private Byte state;

    private Role role;

    private UserInfo userInfo;

    private static final long serialVersionUID = 1L;

    public User(Integer id, String username, String password, Integer roleId, Date createTime, String userImg, Byte state) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.roleId = roleId;
        this.createTime = createTime;
        this.userImg = userImg;
        this.state = state;
    }



    public User() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUserImg() {
        return userImg;
    }

    public void setUserImg(String userImg) {
        this.userImg = userImg == null ? null : userImg.trim();
    }

    public Byte getState() {
        return state;
    }

    public void setState(Byte state) {
        this.state = state;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public UserInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }

//    @Override
//    public String toString() {
//        StringBuilder sb = new StringBuilder();
//        sb.append(getClass().getSimpleName());
//        sb.append(" [");
//        sb.append("Hash = ").append(hashCode());
//        sb.append(", id=").append(id);
//        sb.append(", username=").append(username);
//        sb.append(", password=").append(password);
//        sb.append(", roleId=").append(roleId);
//        sb.append(", createTime=").append(createTime);
//        sb.append(", userImg=").append(userImg);
//        sb.append(", state=").append(state);
//        sb.append("]");
//        return sb.toString();
//    }


    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", roleId=" + roleId +
                ", createTime=" + createTime +
                ", userImg='" + userImg + '\'' +
                ", state=" + state +
                ", role=" + role +
                ", userInfo=" + userInfo +
                '}';
    }
}